package com.xja.controller;

import com.xja.common.JsonBean;
import com.xja.entity.SysStaff;
import com.xja.service.SysStaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author CHENCHEN
 * @company 北京学佳澳教育科技
 * @create 2024-01-15 10:52
 */
@RestController
@RequestMapping("sysStaff")
public class SysStaffController {

    @Autowired
    private SysStaffService sysStaffService;

    @GetMapping("getList")
    public JsonBean getList(){

        return sysStaffService.selectList();
    }

    @GetMapping("selectById")
    public JsonBean selectById(Integer id){

        return sysStaffService.selectById(id);
    }

    @GetMapping("deleteById")
    public JsonBean deleteById(Integer id){

        return sysStaffService.deleteById(id);
    }

    @PostMapping("insertStaff")
    public JsonBean insertStaff(SysStaff sysStaff){

        return sysStaffService.insertStaff(sysStaff);
    }

    @PostMapping("updateStaff")
    public JsonBean updateStaff(SysStaff sysStaff){

        return sysStaffService.updateStaff(sysStaff);
    }

}
